{template nheader.html}
<link href="{THEME_PATH}admin/global/css/add_banner.css?t={time()}.{rand(10000,9999999)}" rel="stylesheet"  />
<link href="{THEME_PATH}admin/global/css/form_default.css?t={time()}.{rand(10000,9999999)}" rel="stylesheet"  />
<script src="{THEME_PATH}admin/global/scripts/add_banner.js?t={time()}.{rand(10000,9999999)}"></script>

<script>
    function uploadFile(){
        //alert('123');
        var myform = new FormData();
        myform.append('img',$('#load_img')[0].files[0]);
        // console.log(s);return false;
        $.ajax({
            url: "admin.php?c=banner&m=uploadImg",
            type: "POST",
            data: myform,
            contentType: false,
            processData: false,
            success: function (data) {
                console.log(data);
                var obj = JSON.parse(data);
                if(obj.status == 1){
                    $('input[name="upload_img"]').val(obj.img_url);
                    $(".image-data").html(obj.img_url);
                    $('.update-class-pic').css('cssText','background-image:url('+obj.img_url+');');
                    $(".update-word-add").fadeOut();
                }
                else{
                    $(".image-data").text("格式错误，请重新选择");
                    $(".update-word-add").fadeIn();
                }
            },
            error:function(data){
                console.log(data);
            }
        });
    }
</script>
<form class="form-horizontal le_enter_order" action="" method="post" id="myform" name="myform" style="margin-top:30px;margin-bottom: 70px;">
    <input type="hidden" name="upload_img" value=""/>
    <div class="portlet light bordered">

        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green bold uppercase"><span style='font-family: "FontAwesome";'></span> {$name}</span>
            </div>
        </div>
        <div class="portlet-body">
            <div class="portlet-body form">
                <div class="form-body">
                    <div class="le_2_col box_required">
                        <div class="form-group leisure_2_2_col">
                            <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('添加Banner至')}：</label>
                            <div class="col-md-9">
                                <label>
                                    <select class="form-control" name="client">
                                        <option value="PC端">PC端</option>
                                        <option value="移动端">移动端</option>
                                    </select>
                                </label>
                            </div>
                        </div>

                        <div class="form-group leisure_2_1_col ">
                            <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('名称')}：</label>
                            <div class="col-md-9">
                                <label>{dr_field_input('name','Text', $field['name']['setting'], $data['name'])}</label>
                            </div>
                        </div>
                        <div class="form-group leisure_2_2_col">
                            <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('选择投放频道')}：</label>
                            <div class="col-md-9">
                                <label>
                                    <select class="form-control" name="part">
                                        <option value="">请选择</option>
                                        {loop $banners $banner}
                                                <option value="{$banner}">{$banner}</option>
                                        {/loop}

                                    </select>
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="le_2_col">
                        <div class="form-group leisure_2_1_col">
                            <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('填写展示顺序')}：</label>
                            <div class="col-md-9">
                                <!--
                                <label>
                                    <select class="form-control">
                                        <option value="">请选择</option>
                                        <option value="1">1</option>
                                    </select>
                                </label>
                                -->
                                <label>{dr_field_input('sort','Text', $field['sort']['setting'], $data['sort'])}</label>
                            </div>
                        </div>
                        <div class="form-group leisure_2_2_col">
                            <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('上传课程封面')}：</label>
                            <label class="update-class-pic">
                                <span class="image-data">未选择任何档案</span>
                                <input type="file" id="load_img" name="img" onchange ="uploadFile()"/>
                                <span class="update-word-add">
                                        <p>+</p>
                                    </span>
                            </label>
                            <p>只能上传jpg/png格式文件，文件不能超过100kb</p>
                        </div>
                    </div>

                </div>
            </div>
        </div>


        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green bold uppercase"><span style='font-family: "FontAwesome";'></span> {fc_lang('设置跳转地址')}</span>
            </div>
        </div>
        <div class="portlet-body">
            <div class="portlet-body form">
                <div class="form-body">
                    <div class="le_2_col box_required">

                        <div class="form-group jump_address">
                            <label class="col-md-2 control-label">{fc_lang('跳转地址')}：</label>
                            <div class="col-md-9">
                                <label>
                                    <select class="form-control" name="skip">
                                        <option value="2">不跳转</option>
                                        <option value="1">表单</option>
                                        <option value="0">落地页</option>
                                    </select>
                                </label>
                                <div class="prompt">若点击banner需跳转表单或落地页，请选择上述资讯</div>
                            </div>
                        </div>

                        <div class="banner-poup-fprm">

                            <div class="form-group ">
                                <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('添加弹窗标题')}：</label>
                                <div class="col-md-9">
                                    <label>{dr_field_input('poptitle','Text', $field['poptitle']['setting'], $data['poptitle'])}</label>
                                    <div class="prompt">预设：(现在填写报名信息)</div>
                                </div>
                            </div>

                            <div class="form-group ">
                                <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('添加副标题')}：</label>
                                <div class="col-md-9">
                                    <label>{dr_field_input('auxtitle','Text', $field['auxtitle']['setting'], $data['auxtitle'])}</label>
                                    <div class="prompt">预设：(专属名校菁英1对4课程体验！)</div>
                                </div>
                            </div>

                            <div class="form-group ">
                                <label class="col-md-2 control-label">{fc_lang('年级')}：</label>
                                <div class="col-md-9">
                                    <label>{dr_field_input('grade','Text', $field['grade']['setting'], $data['grade'])}</label>
                                    <div class="prompt">如需修改活动年级，请填写在此栏位（例：初一/初二/初三/高一/高二/高三）</div>
                                </div>
                            </div>

                            <div class="form-group ">
                                <label class="col-md-2 control-label">{fc_lang('学科')}：</label>
                                <div class="col-md-9">
                                    <label>{dr_field_input('subject','Text', $field['subject']['setting'], $data['subject'])}</label>
                                    <div class="prompt">如需修改活动学科，请填写在此栏位（例：数学/英语/语文/物理/化学/地理）</div>
                                </div>
                            </div>

                            <div class="form-group ">
                                <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('设置按钮文字')}：</label>
                                <div class="col-md-9">
                                    <label>{dr_field_input('buttontxt','Text', $field['buttontxt']['setting'], $data['buttontxt'])}</label>
                                    <div class="prompt">预设：(获得0元试听)</div>
                                </div>
                            </div>

                            <div class="form-group ">
                                <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('备注活动信息')}：</label>
                                <div class="col-md-9">
                                    <label>{dr_field_input('remark','Text', $field['remark']['setting'], $data['remark'])}</label>
                                    <div class="prompt">预设：(PC：免费试听)</div>
                                </div>
                            </div>

                        </div>

                        <div class="banner-turn-page">
                            <label class="col-md-2 control-label"><span class="required">*</span>{fc_lang('页面地址')}：</label>
                            <div class="col-md-9">
                                <label>{dr_field_input('url','Text', $field['url']['setting'], $data['url'])}</label>
                                <div class="prompt">如果希望点击banner后转跳具体页面，请填写页面URL地址</div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>

        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green bold uppercase"><span style='font-family: "FontAwesome";'></span> {fc_lang('设置自动上下架')}</span>
            </div>
        </div>
        <div class="portlet-body">
            <div class="portlet-body form">
                <div class="form-body">
                    <div class="le_2_col box_required">

                        <div class="class_box">
                            <div class="class_message">
                                <div class="le_3_col message_top">
                                    <div  class="form-group leisure_3_3_col automatic_shelves" >
                                        <label class="col-md-2 control-label">{fc_lang('自动上下架')}：</label>
                                        <div class="col-md-9">
                                            <label>
                                                <select class="form-control" name="is_shelves">
                                                    <option value="0">关闭</option>
                                                    <option value="1">开启</option>
                                                </select>
                                            </label>
                                            <div class="prompt">开启自动上下架后，系统会根据设置的生效日期自动上下架banner</div>
                                        </div>
                                    </div>
                                </div>
                                <div class="le_2_col automatic_shelves_time">
                                    <div class="form-group leisure_2_1_col ">
                                        <label class="col-md-2 control-label">{fc_lang('设置开始日期')}：</label>
                                        <div class="col-md-9">
                                            <label>
                                                <input type="date" name="start_time" id="start_time" class="form-control"/>
                                            </label>
                                        </div>
                                    </div>

                                    <div class="form-group leisure_2_2_col">
                                        <label class="col-md-2 control-label">{fc_lang('设置结束日期')}：</label>
                                        <div class="col-md-9">
                                            <label>
                                                <input type="date" name="end_time" id="end_time" class="form-control"/>
                                            </label>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>


                    </div>
                </div>
            </div>
        </div>


    </div>

    <div class="myfooter">
        <div class="row">
            <div class="portlet-body form">
                <div class="form-body">
                    <div class="form-actions">
                        <div class="row">
                            <div class="col-md-12 text-center">
                                <a class="btn green check">发布</a>
                                <!-- <button type="submit" class="btn green"> <i class="fa fa-save"></i> {fc_lang('发布')}</button> -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>



{template nfooter.html}